*******Do file for: 
****************** Knutsen, Carl Henrik and Hanne Fjelde (2013). Property Rights in Dictatorships: Kings Protect Property Better than Generals or Party Bosses.*********************** 
*********************************************************************Contemporary Politics 19(1): 94-114******************************************************************************

*Note 1: Most variables are gathered from the QoG standard dataset version of 6 april, 2011. However, data are also gathered from other sources (see paper), notably including the dependent variable(s) from the ICRG Researcher's dataset (2/2 2009)
*Note 2: Country identifiers are Gleditsch and Ward (gwno) codes, but some adjustments are made to countries that have split or merged; check by typing "browse gwno country year" 
*Note 3: This do file does not contain the robustness tests conducted on imputed data, described on p.110

* IMPORTANT NOTE: The PRS Group, from which I have purchased the ICRG Researcher's Dataset, does not allow me to post their
* data in original form online. This implies that the investment profile and law and order indices are not part of the public
* replication dataset. As a consequence, most models in the paper cannot be replicated using the publicly available dataset,
* unless one has access to the ICRG Researcher's Dataset (the version the author purchased is dated February 2009). 

**For running the do file on the publicly available dataset, one needs to merge in ICRGInvest ICRGrulelaw ICRGbuerqual, which are the Investment Profile, Law and Order and Bureaucratic Quality indices from the ICRG Researcher's Dataset 

*The following vairables (in the dataset after having urn this do file) are dropped:
*drop ICRGInvest ICRGrulelaw ICRGbuerqual le5ICRGrulelaw le5ICRGInvest le3ICRGrulelaw le3ICRGInvest le1ICRGrulelaw le1ICRGInvest



*clear
*use "*use "M:\Aførsteam\replication\ConPol_publ.dta", clear
keep gwno country year al_ethnic ht_regtype ht_regtype1 p_durable wdi_gdp wdi_gdpc wdi_gdpcgr wdi_gdpgr wdi_pop wr_mir wr_mor wr_mpr wr_ppf wr_pr wr_spmpr wr_spmr wr_sppr wr_spr gwno ICRGInvest ICRGrulelaw easteursov africass asiapac mideanafr latam sunni shia catholic protestanglic orthodox hindu budhkonfutaoshinto indigeneous britishameric french portugese spanish belgian growthoilinc logoilinc ICRGbuerqual statehist5

xtset gwno year
sort gwno year

***Generate the regime type dummies
generate monarchy=.
generate military=.
generate oneparty=.
generate multiparty=.
generate noparty=.
generate otherdict=.
generate democracy=.

replace monarchy=0 if ht_regtype1!=.
replace monarchy=1 if ht_regtype1==1

replace military=0 if ht_regtype1!=.
replace military=1 if ht_regtype1==2

replace oneparty=0 if ht_regtype1!=.
replace oneparty=1 if ht_regtype1==3

replace multiparty=0 if ht_regtype1!=.
replace multiparty=1 if ht_regtype1==4

replace noparty=0 if ht_regtype1!=.
replace noparty=1 if ht_regtype1==9

replace otherdict=0 if ht_regtype1!=.
replace otherdict=1 if ht_regtype1==99

replace democracy=0 if ht_regtype1!=.
replace democracy=1 if ht_regtype1==100

generate other = otherdict+noparty	


**Generate the regime institution dummies
generate MILITARY = .
replace MILITARY = 0 if  ht_regtype!=.
replace MILITARY = 1 if  ht_regtype==4 | ht_regtype==5 | ht_regtype==6 | ht_regtype==7 | ht_regtype==18 

generate MONARCHY = .
replace MONARCHY = 0 if  ht_regtype!=.
replace MONARCHY = 1 if  ht_regtype==17 | ht_regtype==23 | ht_regtype==24

generate PARTY = .
replace PARTY = 0 if  ht_regtype!=.
replace PARTY = 1 if  ht_regtype==1 | ht_regtype==2 | ht_regtype==6 | ht_regtype==24 | ht_regtype==7 | ht_regtype==8

**generate the combined ICRG dependent variable for robustness testing
generate ICRGprop = (ICRGInvest+2*ICRGrulelaw)


* Generate lead +1 variables
by gwno, sort: generate le1ICRGInvest = ICRGInvest[_n+1]
sort gwno year
by gwno, sort: generate le1ICRGrulelaw = ICRGrulelaw[_n+1]
sort gwno year
by gwno, sort: generate le1ICRGprop = ICRGprop[_n+1]
sort gwno year

* Generate lead +3 dependent variables
by gwno, sort: generate le3ICRGInvest = ICRGInvest[_n+3]
sort gwno year
by gwno, sort: generate le3ICRGrulelaw = ICRGrulelaw[_n+3]
sort gwno year
by gwno, sort: generate le3ICRGprop = ICRGprop[_n+3]
sort gwno year

* * Generate lead +5 dependent variables
by gwno, sort: generate le5ICRGInvest = ICRGInvest[_n+5]
sort gwno year
by gwno, sort: generate le5ICRGrulelaw = ICRGrulelaw[_n+5]
sort gwno year
by gwno, sort: generate le5ICRGprop = ICRGprop[_n+5]
sort gwno year

*********************************************************************************
** Table 1. Average scores on property rights indices, by regime type (p. 102) **
*********************************************************************************

summarize ICRGInvest ICRGrulelaw ICRGprop  if democracy==1
summarize ICRGInvest ICRGrulelaw ICRGprop  if monarchy==1
summarize ICRGInvest ICRGrulelaw ICRGprop  if military==1
summarize ICRGInvest ICRGrulelaw ICRGprop  if oneparty==1
summarize ICRGInvest ICRGrulelaw ICRGprop  if multiparty==1
summarize ICRGInvest ICRGrulelaw ICRGprop  if other==1

* Generate log-variables and year dummies
generate lngdppc = ln(wdi_gdpc)
generate lnpop = ln(wdi_pop)
generate _1970s =0
generate _1980s =0
generate _1990s =0
replace _1970s =1 if year>1969 & year<1980
replace _1980s =1 if year>1979 & year<1990
replace _1990s =1 if year>1989 & year<2000

* Generate lag-structures. Descriptive stats for intro
sort gwno year

** Testing for AR1 autocorrelation (see footnote 8 p. 111-112)
xtregar le1ICRGInvest military oneparty multiparty other democracy lngdppc lnpop logoilinc al_ethnic easteursov africass asiapac mideanafr latam _1980s _1990s, re lbi
** Testing for panel-level heteroskedasticity
xtregar le1ICRGInvest military oneparty multiparty other democracy lngdppc lnpop logoilinc al_ethnic easteursov africass asiapac mideanafr latam _1980s _1990s, fe lbi
xtreg le1ICRGInvest military oneparty multiparty other democracy lngdppc lnpop logoilinc al_ethnic easteursov africass asiapac mideanafr latam _1980s _1990s, fe

ssc install xttest3
xttest3

********************************************************
** OLS Version of Table 2 (see footnote 8 p. 111-112) **
********************************************************

regress le1ICRGInvest military oneparty multiparty other democracy lngdppc lnpop logoilinc al_ethnic easteursov africass asiapac mideanafr latam _1980s _1990s
estimates store oaa
regress le1ICRGrulelaw military oneparty multiparty other democracy lngdppc lnpop logoilinc al_ethnic easteursov africass asiapac mideanafr latam _1980s _1990s
estimates store odd
regress le1ICRGprop military oneparty multiparty other democracy lngdppc lnpop logoilinc al_ethnic easteursov africass asiapac mideanafr latam _1980s _1990s
estimates store oee
regress le1ICRGInvest MONARCHY democracy lngdppc lnpop logoilinc al_ethnic easteursov africass asiapac mideanafr latam _1980s _1990s
estimates store off
regress le1ICRGInvest PARTY democracy lngdppc lnpop logoilinc al_ethnic easteursov africass asiapac mideanafr latam _1980s _1990s
estimates store ogg
regress le1ICRGInvest MILITARY democracy lngdppc lnpop logoilinc al_ethnic easteursov africass asiapac mideanafr latam _1980s _1990s
estimates store ohh
regress le1ICRGInvest MONARCHY PARTY MILITARY democracy lngdppc lnpop logoilinc al_ethnic easteursov africass asiapac mideanafr latam _1980s _1990s
estimates store oii
estout  oaa odd oee off ogg ohh oii, cells(b(star fmt(%9.3f)) t(par fmt(%9.2f))) starlevels (* 0.10 ** 0.05 *** 0.01 **** 0.001) stats (N)style (tex)

*********************************************************************************************************
** Table 2. The effects of dictatorship types and dictatorial institutions on property rights (p. 104) **
*********************************************************************************************************

xtpcse le1ICRGInvest military oneparty multiparty other democracy lngdppc lnpop logoilinc al_ethnic easteursov africass asiapac mideanafr latam _1980s _1990s, correlation(psar1) rhotype(tscorr) pairwise
estimates store aa
xtpcse le1ICRGrulelaw military oneparty multiparty other democracy lngdppc lnpop logoilinc al_ethnic easteursov africass asiapac mideanafr latam _1980s _1990s, correlation(psar1) rhotype(tscorr) pairwise
estimates store dd
xtpcse le1ICRGprop military oneparty multiparty other democracy lngdppc lnpop logoilinc al_ethnic easteursov africass asiapac mideanafr latam _1980s _1990s, correlation(psar1) rhotype(tscorr) pairwise
estimates store ee
xtpcse le1ICRGInvest MONARCHY democracy lngdppc lnpop logoilinc al_ethnic easteursov africass asiapac mideanafr latam _1980s _1990s, correlation(psar1) rhotype(tscorr) pairwise
estimates store ff
xtpcse le1ICRGInvest PARTY democracy lngdppc lnpop logoilinc al_ethnic easteursov africass asiapac mideanafr latam _1980s _1990s, correlation(psar1) rhotype(tscorr) pairwise
estimates store gg
xtpcse le1ICRGInvest MILITARY democracy lngdppc lnpop logoilinc al_ethnic easteursov africass asiapac mideanafr latam _1980s _1990s, correlation(psar1) rhotype(tscorr) pairwise
estimates store hh
xtpcse le1ICRGInvest MONARCHY PARTY MILITARY democracy lngdppc lnpop logoilinc al_ethnic easteursov africass asiapac mideanafr latam _1980s _1990s, correlation(psar1) rhotype(tscorr) pairwise
estimates store ii
estout  aa dd ee ff gg hh ii, cells(b(star fmt(%9.3f)) t(par fmt(%9.2f))) starlevels (* 0.10 ** 0.05 *** 0.01 **** 0.001) stats (N)style (tex)

******************************************************************************************************************
** Table 3. Dictatorship types and property rights, selected robustness checks (p. 108 and discussed on p. 110) **
****************************************************************************************************************** 
* NB: rob4 and rob7 on imputed dataset

xtpcse le1ICRGInvest military oneparty multiparty other lngdppc lnpop logoilinc al_ethnic easteursov africass asiapac mideanafr latam _1980s _1990s if democracy==0, correlation(psar1) rhotype(tscorr) pairwise
estimates store rob1
xtpcse le3ICRGInvest military oneparty multiparty other democracy lngdppc lnpop logoilinc al_ethnic easteursov africass asiapac mideanafr latam _1980s _1990s, correlation(psar1) rhotype(tscorr) pairwise
estimates store rob2
xtpcse le1ICRGInvest military oneparty multiparty other democracy lngdppc lnpop logoilinc al_ethnic easteursov africass asiapac mideanafr latam _1980s _1990s sunni shia catholic protestanglic orthodox hindu budhkonfutaoshinto britishameric french portugese spanish belgian, correlation(psar1) rhotype(tscorr) pairwise
estimates store rob3
xtpcse le1ICRGInvest military oneparty multiparty other lngdppc lnpop logoilinc al_ethnic easteursov africass asiapac mideanafr latam _1980s _1990s if democracy==0, correlation(psar1) rhotype(tscorr) pairwise
estimates store rob4
xtpcse le3ICRGInvest MONARCHY PARTY MILITARY democracy lngdppc lnpop logoilinc al_ethnic easteursov africass asiapac mideanafr latam _1980s _1990s, correlation(psar1) rhotype(tscorr) pairwise
estimates store rob5
xtpcse le1ICRGInvest MONARCHY PARTY MILITARY democracy lngdppc lnpop logoilinc al_ethnic easteursov africass asiapac mideanafr latam _1980s _1990s sunni shia catholic protestanglic orthodox hindu budhkonfutaoshinto britishameric french portugese spanish belgian, correlation(psar1) rhotype(tscorr) pairwise
estimates store rob6
xtpcse le1ICRGInvest MONARCHY PARTY MILITARY democracy lngdppc lnpop logoilinc al_ethnic easteursov africass asiapac mideanafr latam _1980s _1990s, correlation(psar1) rhotype(tscorr) pairwise
estimates store rob7
xtpcse le1ICRGInvest wr_mor lngdppc lnpop logoilinc al_ethnic easteursov africass asiapac mideanafr latam _1980s _1990s, correlation(psar1) rhotype(tscorr) pairwise
estimates store rob8
estout rob1 rob2 rob3 rob4 rob5 rob6 rob7 rob8, cells(b(star fmt(%9.3f)) t(par fmt(%9.2f))) starlevels (* 0.10 ** 0.05 *** 0.01 **** 0.001) stats (N)style (tex)

************************************
***** SENSITIVITY ANALYSES *********
************************************

* Sens 1 - drop lngdppc
xtpcse le1ICRGInvest military oneparty multiparty other democracy lnpop logoilinc al_ethnic easteursov africass asiapac mideanafr latam _1980s _1990s, correlation(psar1) rhotype(tscorr) pairwise
estimates store aa
xtpcse le1ICRGrulelaw military oneparty multiparty other democracy lnpop logoilinc al_ethnic easteursov africass asiapac mideanafr latam _1980s _1990s, correlation(psar1) rhotype(tscorr) pairwise
estimates store dd
xtpcse le1ICRGprop military oneparty multiparty other democracy lnpop logoilinc al_ethnic easteursov africass asiapac mideanafr latam _1980s _1990s, correlation(psar1) rhotype(tscorr) pairwise
estimates store ee
xtpcse le1ICRGInvest MONARCHY democracy lnpop logoilinc al_ethnic easteursov africass asiapac mideanafr latam _1980s _1990s, correlation(psar1) rhotype(tscorr) pairwise
estimates store ff
xtpcse le1ICRGInvest PARTY democracy lnpop logoilinc al_ethnic easteursov africass asiapac mideanafr latam _1980s _1990s, correlation(psar1) rhotype(tscorr) pairwise
estimates store gg
xtpcse le1ICRGInvest MILITARY democracy lnpop logoilinc al_ethnic easteursov africass asiapac mideanafr latam _1980s _1990s, correlation(psar1) rhotype(tscorr) pairwise
estimates store hh
xtpcse le1ICRGInvest MONARCHY PARTY MILITARY democracy lnpop logoilinc al_ethnic easteursov africass asiapac mideanafr latam _1980s _1990s, correlation(psar1) rhotype(tscorr) pairwise
estimates store ii
estout  aa dd ee ff gg hh ii, cells(b(star fmt(%9.3f)) t(par fmt(%9.2f))) starlevels (* 0.10 ** 0.05 *** 0.01 **** 0.001) stats (N)style (tex)

* Sens 2 - drop lnpop
xtpcse le1ICRGInvest military oneparty multiparty other democracy lngdppc logoilinc al_ethnic easteursov africass asiapac mideanafr latam _1980s _1990s, correlation(psar1) rhotype(tscorr) pairwise
estimates store aa
xtpcse le1ICRGrulelaw military oneparty multiparty other democracy lngdppc logoilinc al_ethnic easteursov africass asiapac mideanafr latam _1980s _1990s, correlation(psar1) rhotype(tscorr) pairwise
estimates store dd
xtpcse le1ICRGprop military oneparty multiparty other democracy lngdppc logoilinc al_ethnic easteursov africass asiapac mideanafr latam _1980s _1990s, correlation(psar1) rhotype(tscorr) pairwise
estimates store ee
xtpcse le1ICRGInvest MONARCHY democracy lngdppc logoilinc al_ethnic easteursov africass asiapac mideanafr latam _1980s _1990s, correlation(psar1) rhotype(tscorr) pairwise
estimates store ff
xtpcse le1ICRGInvest PARTY democracy lngdppc logoilinc al_ethnic easteursov africass asiapac mideanafr latam _1980s _1990s, correlation(psar1) rhotype(tscorr) pairwise
estimates store gg
xtpcse le1ICRGInvest MILITARY democracy lngdppc logoilinc al_ethnic easteursov africass asiapac mideanafr latam _1980s _1990s, correlation(psar1) rhotype(tscorr) pairwise
estimates store hh
xtpcse le1ICRGInvest MONARCHY PARTY MILITARY democracy lngdppc logoilinc al_ethnic easteursov africass asiapac mideanafr latam _1980s _1990s, correlation(psar1) rhotype(tscorr) pairwise
estimates store ii
estout  aa dd ee ff gg hh ii, cells(b(star fmt(%9.3f)) t(par fmt(%9.2f))) starlevels (* 0.10 ** 0.05 *** 0.01 **** 0.001) stats (N)style (tex)

* Sens 3 - drop logoilinc
xtpcse le1ICRGInvest military oneparty multiparty other democracy lngdppc lnpop al_ethnic easteursov africass asiapac mideanafr latam _1980s _1990s, correlation(psar1) rhotype(tscorr) pairwise
estimates store aa
xtpcse le1ICRGrulelaw military oneparty multiparty other democracy lngdppc lnpop al_ethnic easteursov africass asiapac mideanafr latam _1980s _1990s, correlation(psar1) rhotype(tscorr) pairwise
estimates store dd
xtpcse le1ICRGprop military oneparty multiparty other democracy lngdppc lnpop al_ethnic easteursov africass asiapac mideanafr latam _1980s _1990s, correlation(psar1) rhotype(tscorr) pairwise
estimates store ee
xtpcse le1ICRGInvest MONARCHY democracy lngdppc lnpop al_ethnic easteursov africass asiapac mideanafr latam _1980s _1990s, correlation(psar1) rhotype(tscorr) pairwise
estimates store ff
xtpcse le1ICRGInvest PARTY democracy lngdppc lnpop al_ethnic easteursov africass asiapac mideanafr latam _1980s _1990s, correlation(psar1) rhotype(tscorr) pairwise
estimates store gg
xtpcse le1ICRGInvest MILITARY democracy lngdppc lnpop al_ethnic easteursov africass asiapac mideanafr latam _1980s _1990s, correlation(psar1) rhotype(tscorr) pairwise
estimates store hh
xtpcse le1ICRGInvest MONARCHY PARTY MILITARY democracy lngdppc lnpop al_ethnic easteursov africass asiapac mideanafr latam _1980s _1990s, correlation(psar1) rhotype(tscorr) pairwise
estimates store ii
estout  aa dd ee ff gg hh ii, cells(b(star fmt(%9.3f)) t(par fmt(%9.2f))) starlevels (* 0.10 ** 0.05 *** 0.01 **** 0.001) stats (N)style (tex)

* Sens 4 - drop al_ethnic
xtpcse le1ICRGInvest military oneparty multiparty other democracy lngdppc lnpop logoilinc easteursov africass asiapac mideanafr latam _1980s _1990s, correlation(psar1) rhotype(tscorr) pairwise
estimates store aa
xtpcse le1ICRGrulelaw military oneparty multiparty other democracy lngdppc lnpop logoilinc easteursov africass asiapac mideanafr latam _1980s _1990s, correlation(psar1) rhotype(tscorr) pairwise
estimates store dd
xtpcse le1ICRGprop military oneparty multiparty other democracy lngdppc lnpop logoilinc easteursov africass asiapac mideanafr latam _1980s _1990s, correlation(psar1) rhotype(tscorr) pairwise
estimates store ee
xtpcse le1ICRGInvest MONARCHY democracy lngdppc lnpop logoilinc easteursov africass asiapac mideanafr latam _1980s _1990s, correlation(psar1) rhotype(tscorr) pairwise
estimates store ff
xtpcse le1ICRGInvest PARTY democracy lngdppc lnpop logoilinc easteursov africass asiapac mideanafr latam _1980s _1990s, correlation(psar1) rhotype(tscorr) pairwise
estimates store gg
xtpcse le1ICRGInvest MILITARY democracy lngdppc lnpop logoilinc easteursov africass asiapac mideanafr latam _1980s _1990s, correlation(psar1) rhotype(tscorr) pairwise
estimates store hh
xtpcse le1ICRGInvest MONARCHY PARTY MILITARY democracy lngdppc lnpop logoilinc easteursov africass asiapac mideanafr latam _1980s _1990s, correlation(psar1) rhotype(tscorr) pairwise
estimates store ii
estout  aa dd ee ff gg hh ii, cells(b(star fmt(%9.3f)) t(par fmt(%9.2f))) starlevels (* 0.10 ** 0.05 *** 0.01 **** 0.001) stats (N)style (tex)

* Sens 5 - drop all regions
xtpcse le1ICRGInvest military oneparty multiparty other lngdppc lnpop logoilinc al_ethnic _1980s _1990s if democracy==0, correlation(psar1) rhotype(tscorr) pairwise
estimates store rob1
xtpcse le3ICRGInvest military oneparty multiparty other democracy lngdppc lnpop logoilinc al_ethnic _1980s _1990s, correlation(psar1) rhotype(tscorr) pairwise
estimates store rob2
xtpcse le1ICRGInvest military oneparty multiparty other democracy lngdppc lnpop logoilinc al_ethnic _1980s _1990s sunni shia catholic protestanglic orthodox hindu budhkonfutaoshinto britishameric french portugese spanish belgian, correlation(psar1) rhotype(tscorr) pairwise
estimates store rob3
xtpcse le1ICRGInvest military oneparty multiparty other lngdppc lnpop logoilinc al_ethnic _1980s _1990s if democracy==0, correlation(psar1) rhotype(tscorr) pairwise
estimates store rob4
xtpcse le3ICRGInvest MONARCHY PARTY MILITARY democracy lngdppc lnpop logoilinc al_ethnic _1980s _1990s, correlation(psar1) rhotype(tscorr) pairwise
estimates store rob5
xtpcse le1ICRGInvest MONARCHY PARTY MILITARY democracy lngdppc lnpop logoilinc al_ethnic _1980s _1990s sunni shia catholic protestanglic orthodox hindu budhkonfutaoshinto britishameric french portugese spanish belgian, correlation(psar1) rhotype(tscorr) pairwise
estimates store rob6
xtpcse le1ICRGInvest MONARCHY PARTY MILITARY democracy lngdppc lnpop logoilinc al_ethnic _1980s _1990s, correlation(psar1) rhotype(tscorr) pairwise
estimates store rob7
xtpcse le1ICRGInvest wr_mor lngdppc lnpop logoilinc al_ethnic _1980s _1990s, correlation(psar1) rhotype(tscorr) pairwise
estimates store rob8
estout rob1 rob2 rob3 rob4 rob5 rob6 rob7 rob8, cells(b(star fmt(%9.3f)) t(par fmt(%9.2f))) starlevels (* 0.10 ** 0.05 *** 0.01 **** 0.001) stats (N)style (tex)

* Sens 6 - drop time dummies
xtpcse le1ICRGInvest military oneparty multiparty other lngdppc lnpop logoilinc al_ethnic easteursov africass asiapac mideanafr latam if democracy==0, correlation(psar1) rhotype(tscorr) pairwise
estimates store rob1
xtpcse le3ICRGInvest military oneparty multiparty other democracy lngdppc lnpop logoilinc al_ethnic easteursov africass asiapac mideanafr latam, correlation(psar1) rhotype(tscorr) pairwise
estimates store rob2
xtpcse le1ICRGInvest military oneparty multiparty other democracy lngdppc lnpop logoilinc al_ethnic easteursov africass asiapac mideanafr latam sunni shia catholic protestanglic orthodox hindu budhkonfutaoshinto britishameric french portugese spanish belgian, correlation(psar1) rhotype(tscorr) pairwise
estimates store rob3
xtpcse le1ICRGInvest military oneparty multiparty other lngdppc lnpop logoilinc al_ethnic easteursov africass asiapac mideanafr latam if democracy==0, correlation(psar1) rhotype(tscorr) pairwise
estimates store rob4
xtpcse le3ICRGInvest MONARCHY PARTY MILITARY democracy lngdppc lnpop logoilinc al_ethnic easteursov africass asiapac mideanafr latam, correlation(psar1) rhotype(tscorr) pairwise
estimates store rob5
xtpcse le1ICRGInvest MONARCHY PARTY MILITARY democracy lngdppc lnpop logoilinc al_ethnic easteursov africass asiapac mideanafr latam sunni shia catholic protestanglic orthodox hindu budhkonfutaoshinto britishameric french portugese spanish belgian, correlation(psar1) rhotype(tscorr) pairwise
estimates store rob6
xtpcse le1ICRGInvest MONARCHY PARTY MILITARY democracy lngdppc lnpop logoilinc al_ethnic easteursov africass asiapac mideanafr latam, correlation(psar1) rhotype(tscorr) pairwise
estimates store rob7
xtpcse le1ICRGInvest wr_mor lngdppc lnpop logoilinc al_ethnic easteursov africass asiapac mideanafr latam, correlation(psar1) rhotype(tscorr) pairwise
estimates store rob8
estout rob1 rob2 rob3 rob4 rob5 rob6 rob7 rob8, cells(b(star fmt(%9.3f)) t(par fmt(%9.2f))) starlevels (* 0.10 ** 0.05 *** 0.01 **** 0.001) stats (N)style (tex)

********************************
*** DIFFERENT LAG STRUCTURES ***
********************************

** No lag structure
xtpcse ICRGInvest military oneparty multiparty other democracy lngdppc lnpop logoilinc al_ethnic easteursov africass asiapac mideanafr latam _1970s _1980s _1990s if monarchy+military+multiparty+oneparty+other+democracy==1, correlation(psar1) rhotype(tscorr) pairwise
estimates store aa
xtpcse ICRGInvest military oneparty multiparty other democracy lngdppc lnpop logoilinc al_ethnic easteursov africass asiapac mideanafr latam _1970s _1980s _1990s sunni shia catholic protestanglic orthodox hindu budhkonfutaoshinto  britishameric french portugese spanish belgian, correlation(psar1) rhotype(tscorr) pairwise
estimates store bb
xtpcse ICRGrulelaw military oneparty multiparty other democracy lngdppc lnpop logoilinc al_ethnic easteursov africass asiapac mideanafr latam _1970s _1980s _1990s, correlation(psar1) rhotype(tscorr) pairwise
estimates store dd
xtpcse ICRGprop military oneparty multiparty other democracy lngdppc lnpop logoilinc al_ethnic easteursov africass asiapac mideanafr latam _1970s _1980s _1990s, correlation(psar1) rhotype(tscorr) pairwise
estimates store ee
xtpcse ICRGInvest MONARCHY democracy lngdppc lnpop logoilinc al_ethnic easteursov africass asiapac mideanafr latam _1970s _1980s _1990s, correlation(psar1) rhotype(tscorr) pairwise
estimates store ff
xtpcse ICRGInvest PARTY democracy lngdppc lnpop logoilinc al_ethnic easteursov africass asiapac mideanafr latam _1970s _1980s _1990s, correlation(psar1) rhotype(tscorr) pairwise
estimates store gg
xtpcse ICRGInvest MILITARY democracy lngdppc lnpop logoilinc al_ethnic easteursov africass asiapac mideanafr latam _1970s _1980s _1990s, correlation(psar1) rhotype(tscorr) pairwise
estimates store hh
estout  aa bb dd ee ff gg hh, cells("b(star fmt(3)) t(fmt(2))") starlevels (* 0.10 ** 0.05 *** 0.01) stats (N)style (tex)

** 3 year lag structure
xtpcse le3ICRGInvest military oneparty multiparty other democracy lngdppc lnpop logoilinc al_ethnic easteursov africass asiapac mideanafr latam _1980s _1990s, correlation(psar1) rhotype(tscorr) pairwise
estimates store aa
xtpcse le3ICRGrulelaw military oneparty multiparty other democracy lngdppc lnpop logoilinc al_ethnic easteursov africass asiapac mideanafr latam _1980s _1990s, correlation(psar1) rhotype(tscorr) pairwise
estimates store dd
xtpcse le3ICRGprop military oneparty multiparty other democracy lngdppc lnpop logoilinc al_ethnic easteursov africass asiapac mideanafr latam _1980s _1990s, correlation(psar1) rhotype(tscorr) pairwise
estimates store ee
xtpcse le3ICRGInvest MONARCHY democracy lngdppc lnpop logoilinc al_ethnic easteursov africass asiapac mideanafr latam _1980s _1990s, correlation(psar1) rhotype(tscorr) pairwise
estimates store ff
xtpcse le3ICRGInvest PARTY democracy lngdppc lnpop logoilinc al_ethnic easteursov africass asiapac mideanafr latam _1980s _1990s, correlation(psar1) rhotype(tscorr) pairwise
estimates store gg
xtpcse le3ICRGInvest MILITARY democracy lngdppc lnpop logoilinc al_ethnic easteursov africass asiapac mideanafr latam _1980s _1990s, correlation(psar1) rhotype(tscorr) pairwise
estimates store hh
xtpcse le3ICRGInvest MONARCHY PARTY MILITARY democracy lngdppc lnpop logoilinc al_ethnic easteursov africass asiapac mideanafr latam _1980s _1990s, correlation(psar1) rhotype(tscorr) pairwise
estimates store ii
estout  aa dd ee ff gg hh ii, cells(b(star fmt(%9.3f)) t(par fmt(%9.2f))) starlevels (* 0.10 ** 0.05 *** 0.01 **** 0.001) stats (N)style (tex)

** 5 year lag structure
xtpcse le5ICRGInvest military oneparty multiparty other democracy lngdppc lnpop logoilinc al_ethnic easteursov africass asiapac mideanafr latam _1980s _1990s, correlation(psar1) rhotype(tscorr) pairwise
estimates store aa
xtpcse le5ICRGrulelaw military oneparty multiparty other democracy lngdppc lnpop logoilinc al_ethnic easteursov africass asiapac mideanafr latam _1980s _1990s, correlation(psar1) rhotype(tscorr) pairwise
estimates store dd
xtpcse le5ICRGprop military oneparty multiparty other democracy lngdppc lnpop logoilinc al_ethnic easteursov africass asiapac mideanafr latam _1980s _1990s, correlation(psar1) rhotype(tscorr) pairwise
estimates store ee
xtpcse le5ICRGInvest MONARCHY democracy lngdppc lnpop logoilinc al_ethnic easteursov africass asiapac mideanafr latam _1980s _1990s, correlation(psar1) rhotype(tscorr) pairwise
estimates store ff
xtpcse le5ICRGInvest PARTY democracy lngdppc lnpop logoilinc al_ethnic easteursov africass asiapac mideanafr latam _1980s _1990s, correlation(psar1) rhotype(tscorr) pairwise
estimates store gg
xtpcse le5ICRGInvest MILITARY democracy lngdppc lnpop logoilinc al_ethnic easteursov africass asiapac mideanafr latam _1980s _1990s, correlation(psar1) rhotype(tscorr) pairwise
estimates store hh
xtpcse le5ICRGInvest MONARCHY PARTY MILITARY democracy lngdppc lnpop logoilinc al_ethnic easteursov africass asiapac mideanafr latam _1980s _1990s, correlation(psar1) rhotype(tscorr) pairwise
estimates store ii
estout  aa dd ee ff gg hh ii, cells(b(star fmt(%9.3f)) t(par fmt(%9.2f))) starlevels (* 0.10 ** 0.05 *** 0.01 **** 0.001) stats (N)style (tex)

*****************************************************
** Table 2 controlling for state capacity (p. 107) **
*****************************************************

* Bureaucratic quality index as dependent variable
xtpcse le1ICRGInvest ICRGbuerqual military oneparty multiparty other democracy lngdppc lnpop logoilinc al_ethnic easteursov africass asiapac mideanafr latam _1980s _1990s, correlation(psar1) rhotype(tscorr) pairwise
estimates store aa
xtpcse le1ICRGrulelaw ICRGbuerqual military oneparty multiparty other democracy lngdppc lnpop logoilinc al_ethnic easteursov africass asiapac mideanafr latam _1980s _1990s, correlation(psar1) rhotype(tscorr) pairwise
estimates store dd
xtpcse le1ICRGprop ICRGbuerqual military oneparty multiparty other democracy lngdppc lnpop logoilinc al_ethnic easteursov africass asiapac mideanafr latam _1980s _1990s, correlation(psar1) rhotype(tscorr) pairwise
estimates store ee
xtpcse le1ICRGInvest ICRGbuerqual MONARCHY democracy lngdppc lnpop logoilinc al_ethnic easteursov africass asiapac mideanafr latam _1980s _1990s, correlation(psar1) rhotype(tscorr) pairwise
estimates store ff
xtpcse le1ICRGInvest ICRGbuerqual PARTY democracy lngdppc lnpop logoilinc al_ethnic easteursov africass asiapac mideanafr latam _1980s _1990s, correlation(psar1) rhotype(tscorr) pairwise
estimates store gg
xtpcse le1ICRGInvest ICRGbuerqual MILITARY democracy lngdppc lnpop logoilinc al_ethnic easteursov africass asiapac mideanafr latam _1980s _1990s, correlation(psar1) rhotype(tscorr) pairwise
estimates store hh
xtpcse le1ICRGInvest ICRGbuerqual MONARCHY PARTY MILITARY democracy lngdppc lnpop logoilinc al_ethnic easteursov africass asiapac mideanafr latam _1980s _1990s, correlation(psar1) rhotype(tscorr) pairwise
estimates store ii
estout  aa dd ee ff gg hh ii, cells(b(star fmt(%9.3f)) t(par fmt(%9.2f))) starlevels (* 0.10 ** 0.05 *** 0.01 **** 0.001) stats (N)style (tex)

* Statehist5 (Bockstette et al. 2002) as dependent variable
xtpcse le1ICRGInvest statehist5 military oneparty multiparty other democracy lngdppc lnpop logoilinc al_ethnic easteursov africass asiapac mideanafr latam _1980s _1990s, correlation(psar1) rhotype(tscorr) pairwise
estimates store aa
xtpcse le1ICRGrulelaw statehist5 military oneparty multiparty other democracy lngdppc lnpop logoilinc al_ethnic easteursov africass asiapac mideanafr latam _1980s _1990s, correlation(psar1) rhotype(tscorr) pairwise
estimates store dd
xtpcse le1ICRGprop statehist5 military oneparty multiparty other democracy lngdppc lnpop logoilinc al_ethnic easteursov africass asiapac mideanafr latam _1980s _1990s, correlation(psar1) rhotype(tscorr) pairwise
estimates store ee
xtpcse le1ICRGInvest statehist5 MONARCHY democracy lngdppc lnpop logoilinc al_ethnic easteursov africass asiapac mideanafr latam _1980s _1990s, correlation(psar1) rhotype(tscorr) pairwise
estimates store ff
xtpcse le1ICRGInvest statehist5 PARTY democracy lngdppc lnpop logoilinc al_ethnic easteursov africass asiapac mideanafr latam _1980s _1990s, correlation(psar1) rhotype(tscorr) pairwise
estimates store gg
xtpcse le1ICRGInvest statehist5 MILITARY democracy lngdppc lnpop logoilinc al_ethnic easteursov africass asiapac mideanafr latam _1980s _1990s, correlation(psar1) rhotype(tscorr) pairwise
estimates store hh
xtpcse le1ICRGInvest statehist5 MONARCHY PARTY MILITARY democracy lngdppc lnpop logoilinc al_ethnic easteursov africass asiapac mideanafr latam _1980s _1990s, correlation(psar1) rhotype(tscorr) pairwise
estimates store ii
estout  aa dd ee ff gg hh ii, cells(b(star fmt(%9.3f)) t(par fmt(%9.2f))) starlevels (* 0.10 ** 0.05 *** 0.01 **** 0.001) stats (N)style (tex)

******************************************
** Control for regime duration (p. 107) **
******************************************

generate logdur = ln(p_durable+1)

xtpcse le1ICRGInvest logdur military oneparty multiparty other democracy lngdppc lnpop logoilinc al_ethnic easteursov africass asiapac mideanafr latam _1980s _1990s, correlation(psar1) rhotype(tscorr) pairwise
estimates store aa
xtpcse le1ICRGrulelaw logdur military oneparty multiparty other democracy lngdppc lnpop logoilinc al_ethnic easteursov africass asiapac mideanafr latam _1980s _1990s, correlation(psar1) rhotype(tscorr) pairwise
estimates store dd
xtpcse le1ICRGprop logdur military oneparty multiparty other democracy lngdppc lnpop logoilinc al_ethnic easteursov africass asiapac mideanafr latam _1980s _1990s, correlation(psar1) rhotype(tscorr) pairwise
estimates store ee
xtpcse le1ICRGInvest logdur MONARCHY democracy lngdppc lnpop logoilinc al_ethnic easteursov africass asiapac mideanafr latam _1980s _1990s, correlation(psar1) rhotype(tscorr) pairwise
estimates store ff
xtpcse le1ICRGInvest logdur PARTY democracy lngdppc lnpop logoilinc al_ethnic easteursov africass asiapac mideanafr latam _1980s _1990s, correlation(psar1) rhotype(tscorr) pairwise
estimates store gg
xtpcse le1ICRGInvest logdur MILITARY democracy lngdppc lnpop logoilinc al_ethnic easteursov africass asiapac mideanafr latam _1980s _1990s, correlation(psar1) rhotype(tscorr) pairwise
estimates store hh
xtpcse le1ICRGInvest logdur MONARCHY PARTY MILITARY democracy lngdppc lnpop logoilinc al_ethnic easteursov africass asiapac mideanafr latam _1980s _1990s, correlation(psar1) rhotype(tscorr) pairwise
estimates store ii
estout  aa dd ee ff gg hh ii, cells(b(star fmt(%9.3f)) t(par fmt(%9.2f))) starlevels (* 0.10 ** 0.05 *** 0.01 **** 0.001) stats (N)style (tex)

************************************************************************
** More robustness checks: Fixed effects versions of Table 2 (p. 107-110) **
************************************************************************ 

xtreg le1ICRGInvest military oneparty multiparty other democracy lngdppc lnpop logoilinc al_ethnic easteursov africass asiapac mideanafr latam _1980s _1990s, fe cluster(gwno)
estimates store aarf
xtreg le1ICRGrulelaw military oneparty multiparty other democracy lngdppc lnpop logoilinc al_ethnic easteursov africass asiapac mideanafr latam _1980s _1990s, fe cluster(gwno)
estimates store ddrf
xtreg le1ICRGprop military oneparty multiparty other democracy lngdppc lnpop logoilinc al_ethnic easteursov africass asiapac mideanafr latam _1980s _1990s, fe cluster(gwno)
estimates store eerf
xtreg le1ICRGInvest MONARCHY democracy lngdppc lnpop logoilinc al_ethnic easteursov africass asiapac mideanafr latam _1980s _1990s, fe cluster(gwno)
estimates store ffrf
xtreg le1ICRGInvest PARTY democracy lngdppc lnpop logoilinc al_ethnic easteursov africass asiapac mideanafr latam _1980s _1990s, fe cluster(gwno)
estimates store ggrf
xtreg le1ICRGInvest MILITARY democracy lngdppc lnpop logoilinc al_ethnic easteursov africass asiapac mideanafr latam _1980s _1990s, fe cluster(gwno)
estimates store hhrf
xtreg le1ICRGInvest MONARCHY PARTY MILITARY democracy lngdppc lnpop logoilinc al_ethnic easteursov africass asiapac mideanafr latam _1980s _1990s, fe cluster(gwno)
estimates store iirf
estout  aarf ddrf eerf ffrf ggrf hhrf iirf, cells(b(star fmt(%9.3f)) t(par fmt(%9.2f))) starlevels (* 0.10 ** 0.05 *** 0.01 **** 0.001) stats (N)style (tex)

**************************************************************************
** More robustness checks: Random effects versions of Table 2 (p. 110) **
**************************************************************************

xtreg le1ICRGInvest military oneparty multiparty other democracy lngdppc lnpop logoilinc al_ethnic easteursov africass asiapac mideanafr latam _1980s _1990s, re cluster(gwno)
estimates store aar
xtreg le1ICRGrulelaw military oneparty multiparty other democracy lngdppc lnpop logoilinc al_ethnic easteursov africass asiapac mideanafr latam _1980s _1990s, re cluster(gwno)
estimates store ddr
xtreg le1ICRGprop military oneparty multiparty other democracy lngdppc lnpop logoilinc al_ethnic easteursov africass asiapac mideanafr latam _1980s _1990s, re cluster(gwno)
estimates store eer
xtreg le1ICRGInvest MONARCHY democracy lngdppc lnpop logoilinc al_ethnic easteursov africass asiapac mideanafr latam _1980s _1990s, re cluster(gwno)
estimates store ffr
xtreg le1ICRGInvest PARTY democracy lngdppc lnpop logoilinc al_ethnic easteursov africass asiapac mideanafr latam _1980s _1990s, re cluster(gwno)
estimates store ggr
xtreg le1ICRGInvest MILITARY democracy lngdppc lnpop logoilinc al_ethnic easteursov africass asiapac mideanafr latam _1980s _1990s, re cluster(gwno)
estimates store hhr
xtreg le1ICRGInvest MONARCHY PARTY MILITARY democracy lngdppc lnpop logoilinc al_ethnic easteursov africass asiapac mideanafr latam _1980s _1990s, re cluster(gwno)
estimates store iir
estout  aar ddr eer ffr ggr hhr iir, cells(b(star fmt(%9.3f)) t(par fmt(%9.2f))) starlevels (* 0.10 ** 0.05 *** 0.01 **** 0.001) stats (N)style (tex)

******************************************
** Hausman tests (footnote 9 on p. 110) **
*******************************************

* Investment profile dependent variable
xtreg le1ICRGInvest military oneparty multiparty other democracy lngdppc lnpop logoilinc _1980s _1990s, fe
estimates store aarf
xtreg le1ICRGInvest military oneparty multiparty other democracy lngdppc lnpop logoilinc al_ethnic easteursov africass asiapac mideanafr latam _1980s _1990s, re
estimates store aar

hausman aarf aar

* Rule of law dependent variable
xtreg le1ICRGrulelaw military oneparty multiparty other democracy lngdppc lnpop logoilinc _1980s _1990s, fe
estimates store aarf
xtreg le1ICRGrulelaw military oneparty multiparty other democracy lngdppc lnpop logoilinc al_ethnic _1980s _1990s easteursov africass asiapac mideanafr latam, re
estimates store aar

hausman aarf aar

* Property rights dependent variable
xtreg le1ICRGprop military oneparty multiparty other democracy lngdppc lnpop logoilinc _1980s _1990s, fe
estimates store aarf
xtreg le1ICRGprop military oneparty multiparty other democracy lngdppc lnpop logoilinc al_ethnic _1980s _1990s easteursov africass asiapac mideanafr latam , re
estimates store aar

hausman aarf aar

*****************************************************************
** Random effect tobit models of Table 2 in footnote 10 p. 112 **
*****************************************************************

xttobit le1ICRGInvest lngdppc, ll(0) ul(12) nolog iterate(5000)
matrix c = e(b)
xttobit le1ICRGInvest military oneparty multiparty other democracy lngdppc lnpop logoilinc al_ethnic easteursov africass asiapac mideanafr latam _1980s _1990s, ll(0) ul(12) nolog iterate(20000)from (c, skip)
estimates store oaa
xttobit le1ICRGrulelaw lngdppc, ll(0) ul(6) nolog iterate(5000)
matrix c = e(b)
xttobit le1ICRGrulelaw military oneparty multiparty other democracy lngdppc lnpop logoilinc al_ethnic easteursov africass asiapac mideanafr latam _1980s _1990s, ll(0) ul(6) nolog iterate(20000)from (c, skip)
estimates store odd
xttobit le1ICRGprop lngdppc, ll(0) ul(24) nolog iterate(5000)
matrix c = e(b)
xttobit le1ICRGprop military oneparty multiparty other democracy lngdppc lnpop logoilinc al_ethnic easteursov africass asiapac mideanafr latam _1980s _1990s, ll(0) ul(24) nolog iterate(20000)from (c, skip)
estimates store oee
xttobit le1ICRGInvest lngdppc, ll(0) ul(12) nolog iterate(5000)
matrix c = e(b)
xttobit le1ICRGInvest MONARCHY democracy lngdppc lnpop logoilinc al_ethnic easteursov africass asiapac mideanafr latam _1980s _1990s, ll(0) ul(12) nolog iterate(20000)from (c, skip)
estimates store off
xttobit le1ICRGInvest lngdppc, ll(0) ul(12) nolog iterate(5000)
matrix c = e(b)
xttobit le1ICRGInvest PARTY democracy lngdppc lnpop logoilinc al_ethnic easteursov africass asiapac mideanafr latam _1980s _1990s, ll(0) ul(12) nolog iterate(20000)from (c, skip)
estimates store ogg
xttobit le1ICRGInvest lngdppc, ll(0) ul(12) nolog iterate(5000)
matrix c = e(b)
xttobit le1ICRGInvest MILITARY democracy lngdppc lnpop logoilinc al_ethnic easteursov africass asiapac mideanafr latam _1980s _1990s, ll(0) ul(12) nolog iterate(20000)from (c, skip)
estimates store ohh
xttobit le1ICRGInvest lngdppc, ll(0) ul(12) nolog iterate(5000)
matrix c = e(b)
xttobit le1ICRGInvest MONARCHY PARTY MILITARY democracy lngdppc lnpop logoilinc al_ethnic easteursov africass asiapac mideanafr latam _1980s _1990s, ll(0) ul(12) nolog iterate(20000)from (c, skip)
estimates store oii
estout  oaa odd oee off ogg ohh oii, cells(b(star fmt(%9.3f)) t(par fmt(%9.2f))) starlevels (* 0.10 ** 0.05 *** 0.01 **** 0.001) stats (N)style (tex)

*
*
*
*
* End
*
*
*
*
